package org.lynn.montecarlo;

import lombok.Getter;

import java.awt.*;

/**
 * @author gy
 * @date 2019/6/22 14:07
 */
@Getter
public class Circle {

    public int x;
    public int y;
    private int r;

    public Circle(int x, int y, int r) {
        this.x = x;
        this.y = y;
        this.r = r;
    }

    public boolean contain(Point point) {
        return (x - point.x) * (x - point.x) + (y - point.y) * (y - point.y) <= r * r;
    }
}

